<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>The Name Space (XNS)</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade><blockquote>
<center>
<h3><a name = "tag_000_002">&nbsp;</a>The Name Space (XNS)</h3>
</center>
<xref type="3" name="names"></xref>
<index term="name space, X/Open"></index>
<index term="X/Open name space, "></index>
When _XOPEN_SOURCE is defined, each header defines or declares some
identifiers, potentially conflicting with identifiers used by the
application.  The set of identifiers visible to the application consists of
precisely those identifiers from the header pages of the included headers, as
well as additional identifiers reserved for the implementation.  In addition,
some headers may make visible identifiers from other headers as indicated on
the relevant header pages.
<p>
The identifiers reserved for use by the implementation are
described below.
<ol>
<p>
<li>
Each identifier with external linkage described in the header section
is reserved for use as an identifier with external linkage if the
header is included.
<p>
<li>
Each macro name described in the header section is reserved for
any use if the header is included.
<p>
<li>
Each identifier with file scope described in the header section is
reserved for use as an identifier with file scope in the same
name space if the header is included.
<p>
</ol>
<p>
If any header in the following table is included, identifiers with the
following prefixes or suffixes shown are reserved for any use by the
implementation.
<p><center><p><table  bordercolor=#000000 border=1 cellpadding=3 align=center>
<tr valign=top><th align=left><b>Header</b>
<th align=left><b>Prefix</b>
<th align=left><b>Suffix</b>
<tr valign=top><td align=left><b>&lt;arpa/inet.h&gt;</b>
<td align=left>in_, inet_
<td align=left>&nbsp;
<tr valign=top><td align=left><b>&lt;netdb.h&gt;</b>
<td align=left>h_, n_, p_, s_
<td align=left>&nbsp;
<tr valign=top><td align=left><b>&lt;netinet/in.h&gt;</b>
<td align=left>in_, ip_, s_, sin_
<td align=left>&nbsp;
<tr valign=top><td align=left><b>&lt;sys/socket.h&gt;</b>
<td align=left>sa_, if_, ifc_, ifru_, infu_, ifra_, msg_, cmsg_, l_
<td align=left>&nbsp;
<tr valign=top><td align=left><b>&lt;sys/un.h&gt;</b>
<td align=left>sun_
<td align=left>&nbsp;
<tr valign=top><td align=left><b>&lt;xti.h&gt;</b>
<td align=left>l_, t_, T_
<td align=left>&nbsp;
<tr valign=top><td align=left><b>ANY header</b>
<td align=left>&nbsp;<td align=left>_t
</table>
</center>
<p>
If any header in the following table is included, macros with the prefixes
shown may be defined.  After the last inclusion of a given header, an
application may use identifiers with the corresponding prefixes for its own
purpose, provided their use is preceded by an
<b>#undef</b>
of the corresponding macro.
<p><center><p><table  bordercolor=#000000 border=1 cellpadding=3 align=center>
<tr valign=top><th align=left><b>Header</b>
<th align=left><b>Prefix</b>
<tr valign=top><td align=left><b>&lt;netinet/in.h&gt;</b>
<td align=left>IMPLINK_, IN_, INADDR_, IP_, IPPORT_, IPPROTO_, SOCK_
<tr valign=top><td align=left><b>&lt;sys/socket.h&gt;</b>
<td align=left>AF_, CMSG_, MSG_, PF_, SCM_, SHUT_, SO
<tr valign=top><td align=left><b>&lt;xti.h&gt;</b>
<td align=left>OPT_, T_, XTI_
</table>
</center>
<p>
The following identifiers are reserved regardless of the inclusion of headers:
<ol>
<p>
<li>
All identifiers that begin with an underscore and either an
upper-case letter or another underscore are always reserved for
any use by the implementation.
<p>
<li>
All identifiers that begin with an underscore are always reserved
for use as identifiers with file scope in both the ordinary
identifier and tag name spaces.
<br>
<p>
<li>
All identifiers in the table below are reserved for use as
identifiers with external linkage.
<p><center><p><table  bordercolor=#000000 border=1 cellpadding=3 align=center>
<tr valign=top><th colspan=5 align=left><b>XTI:</b>
<tr valign=top><td align=left> t_accept t_alloc t_bind t_close t_connect t_errno t_error t_free 
<td align=left> &nbsp; t_getinfo t_getprotaddr t_getstate t_listen t_look t_open t_optmgmt 
<td align=left> &nbsp; t_rcv t_rcvconnect t_rcvdis t_rcvrel t_rcvreldata t_rcvudata t_rcvuderr 
<td align=left> &nbsp; t_rcvv t_rcvvudata t_snd t_snd t_snddis t_sndrel t_sndreldata 
<td align=left> &nbsp; t_sndudata t_sndv t_sndvudata t_strerror t_sync t_sysconf t_unbind 
<tr valign=top><td colspan=5 align=left><b>Sockets:</b>
<tr valign=top><td align=left> accept bind connect getpeername 
<td align=left> &nbsp; getsockname getsockopt listen recv 
<td align=left> &nbsp; recvfrom recvmsg send 
<td align=left> &nbsp; sendmsg sendto setsockopt 
<td align=left> &nbsp; shutdown socket socketpair 
<tr valign=top><td colspan=5 align=left><b>IP Address Resolution:</b>
<tr valign=top><td align=left> endhostent endnetent endprotoent endservent gethostbyaddr gethostbyname gethostent 
<td align=left> gethostname getnetbyaddr getnetbyname getnetent getprotobyname getprotobynumber getprotoent 
<td align=left> getservbyname getservbyport getservent h_errno htonl htons 
<td align=left> inet_addr inet_lnaof inet_makeaddr inet_netof inet_network inet_ntoa 
<td align=left> ntohl ntohs sethostent setnetent setprotoent setservent 
</table>
</center>
<p>
</ol>
<p>
All the identifiers defined in this document that have external linkage are
always reserved for use as identifiers with external linkage.
<p>
No other identifiers are reserved.
<p>
Applications must not declare or define identifiers with the same name as an
identifier reserved in the same context. Since macro names are replaced
whenever found, independent of scope and name space, macro names matching any
of the reserved identifier names must not be defined if any associated header
is included.
<p>
Headers may be included in any order, and each may be included more than once
in a given scope, with no difference in effect from that of being included
only once.
<p>
If used, a header must be included outside of any external declaration
or definition, and it must be first included before the first reference
to any type or macro it defines, or to any function or object it declares.
However, if an identifier is declared or defined
in more than one header, the second and subsequent associated headers
may be included after the initial reference to the identifier.
Prior to the inclusion of a header,
the program must not define any macros with names lexically identical
to symbols defined by that header.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

